package message.visitor.tests;

import message.Message;
import network.e2e.FrameReader;
import network.e2e.FrameWriter;
import stalker.Stalker;
import client.network.ServiceRequestCenter;
import data.Data;
import data.content.Content;
import data.datas.Datas;

public class ClientMessageVisitorTestServiceRequestCenterStub extends ServiceRequestCenter {
  
  int cnt = 0;
  
  public ClientMessageVisitorTestServiceRequestCenterStub(Stalker credential, FrameReader reader, FrameWriter writer) {
    super(credential, reader, writer);
    cnt = 0;
  }
  
  public void writeToRoom(Stalker room, Content content) {
    ++cnt;
  }
  
  @Override
  public void requestUpdateRoom(Stalker room) {
    assert (cnt == 3);
    ++cnt;
  }
  
  @Override
  public void requestNewRoom(String roomname) {
    ++cnt;
  }
  
  @Override
  public void requestRoomDatas(Stalker room) {
    ++cnt;
  }
  
  @Override
  public void requestUserFromName(String name) {
    ++cnt;
  }
  
  @Override
  public void inviteToRoom(Stalker target, Stalker room) {
    ++cnt;
  }
  
  @Override
  public void receiveData(Stalker sender, Data data) {
    assert (cnt == 0);
    ++cnt;
  }
  
  @Override
  public void receiveInvitation(Stalker inviter, Stalker room) {
    assert (cnt == 1);
    ++cnt;
  }
  
  @Override
  public void receiveDatas(Stalker sender, Datas datas) {
    assert (cnt == 2);
    ++cnt;
  }
  
  @Override
  public void receiveRejectedMessage(Message message) {
    assert (cnt == 4);
    ++cnt;
  }
  
}
